package com.example.mybaties.testone.aop.common;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Date;

public class MethodPerformance {

    private Logger logger = LogManager.getLogger(this.getClass());

    private String methodName;

    private long startTime;

    private long endTime;

    public MethodPerformance(String methodName) {
        this.methodName = methodName;
        startTime = System.currentTimeMillis();
    }

    public void printPerformance() {
        logger.debug(methodName + "执行消耗的时间为 : " + (System.currentTimeMillis() - startTime));
    }


}
